<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
	<script type='text/javascript' >
		function selectSalestype(field) {
			var div_agent = document.getElementById('agenttype');
			var div_personnel = document.getElementById('personneltype');
			if(field.value == 116/* agenttype.typeid */) {
				div_agent.style.display = '';
				div_personnel.style.display = 'none';
			}else {
				div_agent.style.display = 'none';
				div_personnel.style.display = '';
			}
		}
	</script>
	</head>
	<body bgcolor="#ccddee" link="#000066" vlink="#0066FF" alink="#99FF00">
		<center>
			<div>
				<table>
					<tr>
						<td>
							<s:fielderror cssStyle="color:red" />
							<s:actionerror cssStyle="color:blue"/>
						</td>
					</tr>
				</table>
			</div>
			<s:form method="post" action="addListsales" validate="true" theme="simple">
				<table width="100%" border=1 align="center" cellpadding="0"
					cellspacing="0" bgcolor="#ccddee">
					<tr>
						<td width="15%" align="right">
							销售类型:
						</td>
						<td width="30%" align="left">
							<s:select name="listsales.datadictBySalestype.typeid" list="datadictBySalestypelist" 
									listKey="typeid" 
									listValue="name"
									theme="simple" onchange="selectSalestype(this)"></s:select>
						</td>
						<td align="left">
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							客户编码:
						</td>
						<td width="30%" align="left">	
						<div id="agenttype" style="display: none"  >
							<s:select name="listno" list="agentbaselist" 
									listKey="agentno" 
									listValue="agentcaption"
									headerKey="0" headerValue="选择代理商"
									theme="simple"></s:select>
						</div>
						<div id="personneltype">
							<s:select name="listno" list="personnelsaleslist" 
									listKey="personnelid" 
									listValue="personnelname"
									headerKey="0" headerValue="选择个人客户"
									theme="simple"></s:select>
						</div>
						</td>
						<td align="left">
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							电话:
						</td>
						<td width="30%" align="left">
							<s:textfield name="listsales.phone" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							是否缴费:
						</td>
						<td width="30%" align="left">
							<s:select name="listsales.datadictByPay.typeid" list="datadictByPaylist" 
									listKey="typeid" 
									listValue="name"
									headerKey="0" headerValue="请选择"
									theme="simple"></s:select>
						</td>
						<td align="left">
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							折扣率:
						</td>
						<td width="30%" align="left">
							<s:textfield name="listsales.discount" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
						</td>
					</tr>
				</table>
				<br />
				<br />
				<table>
					<tr>
						<td>
							<s:submit value=" 增 加 " theme="simple" />
						</td>
					</tr>
					<tr>
						<td>
							<s:token name="hello"></s:token>
						</td>
					</tr>
				</table>
			</s:form>
		</center>

	</body>
</html>